<template>
  <div>
    <div class="item-box" v-for="(item,index) in nowPlaying" :key="index" >
      <mvItem :data="item" title="购票" :id="item.id">
        <p slot="other">{{item.pubdates[0]|getFrom()}} | {{item.durations[0]}}</p>
      </mvItem>
    </div>
  </div>
</template>

<script>
export default {
  name: "nowPlaying",
  mounted() {
    var url = "https://douban.uieee.com/v2/movie/in_theaters";
    this.axios.get(url).then(res => {
     
      var datas=res.data.subjects;
      datas.splice(0,2)
      
      this.nowPlaying = datas;
    });
  },
  data() {
    return {
      nowPlaying: []
    };
  },
  filters:{
    getFrom(data){
      var start=data.indexOf("(");
      var end=data.indexOf(")");
      return data.slice(start+1,end)
    }
  }
};
</script>

<style scoped>
</style>

